package com.yehangtech.designpattern.行为型_迭代器模式;

import com.yehangtech.designpattern.行为型_迭代器模式.util.Iterator;
import com.yehangtech.designpattern.行为型_迭代器模式.util.MyArrayList;
import com.yehangtech.designpattern.行为型_迭代器模式.util.MyList;

public class Main {
    public static void main(String[] args) {
        MyList<String> list = new MyArrayList<>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("d");
        list.add("e");
        Iterator<String> iterator = list.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
        System.out.println(list.contains("a"));
    }
}
